package me.zhengjie.modules.readfile.rest;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import me.zhengjie.annotation.Log;
import me.zhengjie.modules.readfile.service.FileService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@Api(tags = "文件预览管理器")
@RestController
@RequestMapping("/api/showFile")
public class FileController {
    private final FileService fileService;
    public FileController(FileService fileService){this.fileService = fileService;}

    @Log("文件预览")
    @ApiOperation("文件预览")
    @PostMapping(value = "/readFile")
    public Boolean readFile(@RequestBody String path){
        return fileService.returnPDF(path);
    }
}
